﻿@using WXY.Course.Web.Areas.Admin.Models;
<div class="m_man">
    <ul>
        <li>
            @Html.RouteLink("返回前台", "Default", new { controller = "Home", action = "Index" }, new { target = "_blank" })
        </li>
        <li>
            <a id="logout" href="javascript:;">退出</a>
        </li>
    </ul>
    <p>
        @{
            var userInfo = AdminContext.GetCurrentUser();
            if (userInfo != null)
            {
                <text>管理员：@userInfo.RealName</text>
            }
        }
    </p>
</div>

<ul class="m_nav j_nav">
    <li class="m_n1">
        <a class="m_t1" href="javascript:void(0);">用户管理</a>
        <ul class="m_sub_nav">
            <li>
                <span class="m_dot"></span>
                <a href="@Url.Action("UserList","Account")">用户列表</a>
            </li>
            <li>
                <span class="m_dot"></span>
                <a href="@Url.Action("UserEdit", "Account", null)">添加用户</a>
            </li>
        </ul>
    </li>
    <li class="m_n1">
        <a class="m_t1" href="javascript:void(0);">模块管理</a>
        <ul class="m_sub_nav">
            <li>
                <span class="m_dot"></span>
                <a href="@Url.Action("List", "Module")">模块列表</a>
            </li>
            <li>
                <span class="m_dot"></span>
                <a href="@Url.Action("Edit", "Module", null)">添加模块</a>
            </li>
        </ul>
    </li>
    <li class="m_n1">
        <a class="m_t1" href="javascript:void(0);">目录管理</a>
        <ul class="m_sub_nav">
            <li>
                <span class="m_dot"></span>
                <a href="@Url.Action("List", "Menu", null)">目录列表</a>
            </li>
            <li>
                <span class="m_dot"></span>
                <a href="@Url.Action("Edit", "Menu", null)">添加目录</a>
            </li>
        </ul>
    </li>
    <li class="m_n1">
        <a class="m_t1" href="javascript:void(0);">资源管理</a>
        <ul class="m_sub_nav">
            <li>
                <span class="m_dot"></span>
                <a href="@Url.Action("List", "Resource")">资源列表</a>
            </li>
            <li>
                <span class="m_dot"></span>
                <a href="@Url.Action("Edit", "Resource",null)">添加资源</a>
            </li>
        </ul>
    </li>
    @*<li class="m_n1">
            <a class="m_t1" href="javascript:void(0);">留言管理</a>
            <ul class="m_sub_nav">
                <li>
                    <span class="m_dot"></span>
                    <a href="@Url.Action("List", "Message")">留言管理</a>
                </li>
            </ul>
        </li>*@
    <li class="m_n1">
        <a class="m_t1" href="javascript:void(0);">首页内容推荐</a>
        <ul class="m_sub_nav">
            <li>
                <span class="m_dot"></span>
                <a href="@Url.Action("List", "Notice")">通知公告</a>
            </li>
            <li>
                <span class="m_dot"></span>
                <a href="@Url.Action("List", "Recommend")">推荐管理</a>
            </li>
        </ul>
    </li>
</ul>
<script type="text/javascript">
    $(function () {
        $('.m_t1').on('click', function () {
            $(this).next('ul').toggle('slow');
        });
        $("#logout").on("click", function () {
            $.post("@Url.Action("LogOut", "Account")", function () {
                location.reload();
            });
        });

        var links = $("ul.j_nav").find('a'), linkSize = links.size();
        if (linkSize > 0) {
            for (var o in links) {
                var currentLink = links[o];
                if (currentLink.localName && currentLink.localName.toUpperCase() == 'A') {
                    var currentLinkHref = $(currentLink).attr('href').toLowerCase();
                    if (location.href.toLowerCase().indexOf(currentLinkHref) >= 0) {
                        $(links[o]).addClass("a_on");
                        $(links[o]).parent().parent().prev("a").addClass("a_on");
                        break;
                    }
                };
            }
        }
    });
</script>
